package com.dcm.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 自定义异常
 *
 * @author PengRongSheng
 * @date 2021/3/23
 **/
@Data
@EqualsAndHashCode(callSuper = false)
public class MyException extends RuntimeException {

    private Integer code = -1;
    private String msg;

    public MyException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public MyException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public MyException(Integer code, String msg) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public MyException(Integer code, String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }
}
